﻿using SqlSugar;
using System.ComponentModel;
using FrameWork.Data.Mapping;
using MongoDB.Bson.Serialization.Attributes;

namespace FrameWork.Data.ViewObject
{
    /// <summary>
    /// 测试数据表
    /// </summary>
    [SugarTable("TestDetailData")]
    public class TestDetailData : ModelBase
    {
        /// <summary>
        /// 测试记录表
        /// </summary>
        [SugarColumn(IndexGroupNameList = new string[] { "Index_TestAndLoopIndex" }, ColumnDescription = "测试记录ID")]
        [Description("测试记录编码")]
        public long TestRecordID { get; set; }


        /// <summary>
        /// 循环序号 充放电
        /// </summary>
        [SugarColumn(IndexGroupNameList = new string[] { "Index_TestAndLoopIndex" }, ColumnDescription = "循环序号")]
        [Description("循环序号")]
        public int LoopIndex { get; set; }

        [SugarColumn(DefaultValue = "-1", ColumnDescription = "工步类型")]
        [Description("工步类型")]
        public int StepType { get; set; }

        [SugarColumn(DefaultValue = "-1", ColumnDescription = "通道号")]
        [Description("通道号")]
        public int Channel { get; set; }

        [SugarColumn(DefaultValue = "-1", ColumnDescription = "事件码")]
        public int EventCode { get; set; }   

        [SugarColumn(IsNullable = true,  ColumnDescription = "事件码名称")]
        public string? EventName { get; set; }

        /// <summary>
        /// 当前跳转循环序号
        /// </summary>
        [SugarColumn(DefaultValue = "-1", ColumnDescription = "当前跳转循环序号")]
        [Description("当前跳转循环号")]
        public int JumpLoopIndex { get; set; }

        /// <summary>
        /// 工步序号
        /// </summary>
        [SugarColumn(DefaultValue = "-1", ColumnDescription = "工步序号")]
        [Description("工步序号")]
        public int StepIndex { get; set; }

        /// <summary>
        /// 累积工步序号
        /// </summary>
        [SugarColumn(DefaultValue = "-1", ColumnDescription = "累积工步序号")]
        [Description("累积工步序号")]
        public int StepAccIndex { get; set; }

        /// <summary>
        /// 序列顺序号
        /// </summary>
        [SugarColumn(ColumnDescription = "记录数据序号")]
        [Description("记录数据序号")]
        public int SeqIndex { get; set; }


        /// <summary>
        /// 模板编号
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "模板编号")]
        [Description("模板编号")]
        public long? TemplateId { get; set; }

        /// <summary>
        /// 过程主键
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "工步编码")]
        [Description("工步编码")]
        public long? WorkStepId { get; set; }

        /// <summary>
        /// 工步名称
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "工步名称")]
        [Description("工步名称")]
        public string StepName { get; set; }

        /// <summary>
        /// 系统时间
        /// </summary>
        [SugarColumn(ColumnDescription = "系统时间")]
        [Description("系统时间")]
        public DateTime SystemTime { get; set; }

        /// <summary>
        /// 相对时间
        /// </summary>
        [SugarColumn(DefaultValue = "0", ColumnDescription = "相对时间")]
        [Description("相对时间")]
        public double RelativeTime { set; get; }

        /// <summary>
        /// 电压
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "电压")]
        [Description("电压")]
        public double? Voltage { get; set; }

        /// <summary>
        /// 电池电压
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "电池电压")]
        [Description("电池电压")]
        public double? BatteryVoltage { get; set; }

        /// <summary>
        /// 电流
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "电流")]
        [Description("电流")]
        public double? Current { get; set; }

        /// <summary>
        /// 电池温度
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "电池温度")]
        [Description("电池温度")]
        public double? BatteryTemperature { get; set; }

        /// <summary>
        /// 电池温度2
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "电池温度2")]
        [Description("电池温度2")]
        public double? BatteryTemperature2 { get; set; }

        /// <summary>
        /// 容量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "容量")]
        [Description("容量")]
        public double? Capacity { get; set; }

        /// <summary>
        /// 充电容量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "充电容量")]
        [Description("充电容量")]
        public double? ChargeCapacity { get; set; }

        /// <summary>
        /// 放电容量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "放电容量")]
        [Description("放电容量")]
        public double? DischargeCapacity { get; set; }

        /// <summary>
        /// 能量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "能量")]
        [Description("能量")]
        public double? Energy { get; set; }

        /// <summary>
        /// 充电能量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "充电能量")]
        [Description("充电能量")]
        public double? ChargeEnergy { get; set; }

        /// <summary>
        /// 放电能量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "放电能量")]
        [Description("放电能量")]
        public double? DischargeEnergy { get; set; }

        /// <summary>
        /// DCIR
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "DCIR")]
        [Description("DCIR")]
        public double? DCIR { get; set; }

        /// <summary>
        /// 功率
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "功率")]
        [Description("功率")]
        public double? Power { get; set; }

        /// <summary>
        /// 外内循环
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "外内循环")]
        [Description("外内循环")]
        public int? InnerOuterRecycle { get; set; }

        /// <summary>
        /// 累积容量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "累积容量")]
        [Description("累积容量")]
        public double? AccCapacity { get; set; }

        /// <summary>
        /// 充电累积容量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "充电累积容量")]
        [Description("充电累积容量")]
        public double? ChargeAccCapacity { get; set; }

        /// <summary>
        /// 放电累积容量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "放电累积容量")]
        [Description("放电累积容量")]
        public double? DischargeAccCapacity { get; set; }

        /// <summary>
        /// 充电累积能量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "充电累积能量")]
        [Description("充电累积能量")]
        public double? ChargeAccEnergy { get; set; }

        /// <summary>
        /// 放电累积能量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "放电累积能量")]
        [Description("放电累积能量")]
        public double? DischargeAccEnergy { get; set; }

        /// <summary>
        /// 累积能量
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "累积能量")]
        [Description("累积能量")]
        public double? AccEnergy { get; set; }

        /// <summary>
        /// 电池温度
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "环境温度")]
        [Description("环境温度")]
        public double? EnvironmentTemperature { get; set; }

        /// <summary>
        /// 电池温度2
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "环境温度2")]
        [Description("环境温度2")]
        public double? EnvironmentTemperature2 { get; set; }

        /// <summary>
        /// 火警温度
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "火警温度")]
        [Description("火警温度")]
        public double? AlarmTemperature { get; set; }

        /// <summary>
        /// 直流内阻
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "直流内阻")]
        [Description("直流内阻")]
        public double? InternalResistance { get; set; }

        /// <summary>
        /// 接触阻抗
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "接触阻抗")]
        [Description("接触阻抗")]
        public double? ContactImpedance { get; set; }

        /// <summary>
        /// 环境值
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "环境值")]
        [Description("环境值 ")]
        public double? EnvironmentVal { get; set; }

        #region ___协助属性___

        /// <summary>
        /// 绝对时间
        /// </summary>
        [SugarColumn(DefaultValue = "0", ColumnDescription = "绝对时间")]
        [Description("绝对时间")]
        [BsonIgnore]
        public double AbsoluteTime { set; get; }

        /// <summary>
        /// 扩展列
        /// </summary>
        [SugarColumn(IsIgnore = true, ColumnDescription = "扩展列")]
        [Description("扩展列")]
        [BsonIgnore]
        public string ExtendColumns { get; set; }

        /// <summary>
        /// 扩展值
        /// </summary>
        [SugarColumn(IsIgnore = true, ColumnDescription = "扩展值")]
        [Description("扩展值")]
        [BsonIgnore]
        public string ExtendColumnValues { get; set; }

        /// <summary>
        /// 扩展值
        /// </summary>
        [SugarColumn(IsIgnore = true, ColumnDescription = "是否工步结束")]
        [Description("是否工步结束")]
        [BsonIgnore]
        public bool IsWorkStepEnd { get; set; }

        [SugarColumn(IsIgnore = true, ColumnDescription = "工步类型标记，充电1，放电0 ，其他0")]
        [Description("工步类型标记，充电1，放电0 ，其他0")]
        [BsonIgnore]
        public int LoopEndFlag { get; set; }




        #endregion ___协助属性___
    }
}